<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">

function ValidatePage(frm)
{
	var university_name = document.getElementById('university_name').value;
	var page_id = document.getElementById('page_id').value;


	if(university_name == "") {
		alert("University Name is empty");
		return false;
	}

	else {
		
		if(page_id == "") {
			document.getElementById('process').value = 'add';
		}
		else {
			document.getElementById('process').value = 'edit';
		}
		document.frm.submit();
	}
	return false;
}
</script>
<?php

$query = mysql_query("select * from university where id='".$_REQUEST['_d']."'") or die(mysql_error());

$res = mysql_fetch_array($query);

if($res["active_status"] == 1) {
	$active_status = "checked";
}
else {
	$deactive_status = "checked";
}
?>
<table border="0" width="100%" align="center">
<tr>
	<td width="46%" align="left"><span style="color:#1B78B7; font-size:14px; font-weight:bold">
    Add University</span>&nbsp; 
	<!--<input type="button" name="addnew" value="Add New" onclick="return show();" />-->
	</td>
	<td width="40%" align="right" class="font12">
    <a href="index.php?tc=university" class="font12">Manage University</a></td>
</tr>
<tr>
	<td background="images/topline.gif" colspan="3" height="11"></td>
</tr>    
</table>
<!--`university_name`, `address`, `location`, `city`, `zone`, `description`, `phone`, `email`, `url`, `active_status`-->
<form name="formPage" method="post" action="action.php" onSubmit="return ValidatePage(this);">
<table width="99%" align="center" border="0"  class="list">
<tr>
	<td align="right" width="250">University Name*</td>
    <td align="left"><input class="text" name="university_name"  id="university_name" type="text" value="<?php echo $res['university_name'];?>"/></td>
</tr>
<tr>
	<td align="right" width="250">URL</td>
    <td align="left"><input class="text" name="url" id="url" type="text" value="<?php echo $res['url'];?>"/></td>
</tr>
<!--<tr>
	<td align="right" width="250">Address</td>
    <td align="left"><textarea name="address" id="address" style="width:200px; height:150px;"><?php echo $res['address'];?></textarea></td>
</tr>
<tr>
	<td align="right" width="250">Zone</td>
    <td align="left">
    <select name="zone" id="zone" class="txtborder" style="width:200px;" onblur="return state(this.value)"  >
 
    <?php 
$ads=mysql_query("select * from zone where active_status='1' order by id ASC");
while($tech=mysql_fetch_array($ads)){
	
	?>

    <option <?php if($res['zone']==$tech['id']){echo "selected";}?> value="<?php echo $tech['id']?>">
	<?php echo $tech['zone_name']?></option>
    <?php }?>
    </select>
    </td>
</tr>
<tr>
	<td align="right" width="250">City</td>
    <td align="left">
    <select name="city" id="txtHint" style="width:200px;"  >
   
<?php 
	
 $ads=mysql_query("select * from city where city_id='".$res['city']."' and active_status='1' order by city_id ASC");
while($tech=mysql_fetch_array($ads)){
	
	?>
      <option <?php if($res['city']==$tech['city_id']){echo "selected";}?>  value="<?php echo  $tech['city_id'];?>">
        <?php //echo $str;?>
         <?php echo $tech['city_name'];?>
         </option> 
         <?php }?>
   </select></td>
</tr>
<tr>
	<td align="right" width="250">Phone</td>
    <td align="left"><input class="text" name="phone" id="phone" type="text" value="<?php echo $res['phone'];?>"/></td>
</tr>
<tr>
	<td align="right" width="250">Email</td>
    <td align="left"><input class="text" name="email" id="email" type="text" value="<?php echo $res['email'];?>"/></td>
</tr>
<tr>
	<td align="right" width="250">URL</td>
    <td align="left"><input class="text" name="url" id="url" type="text" value="<?php echo $res['url'];?>"/></td>
</tr>
<tr>
    <td colspan="100%" align="left"><textarea name="maincont" id="maincont" class="textarea" cols="45" rows="8"><?php echo $res['description'];?></textarea>
        <script type="text/javascript">CKEDITOR.replace( 'maincont',{skin : 'kama'});</script></td>
</tr>
<tr>-->
  <td align="right" width="150">Status :</td>
  <td align="left">
  <input name="authorised" type="radio"  value=1 <?php echo $active_status;?> />&nbsp;Active&nbsp;&nbsp;
  <input name="authorised" type="radio" value=0 <?php echo $deactive_status;?>/>&nbsp;Deactive</td>
</tr>
<tr>
	<td align="right" width="150"></td>
    <td align="left">
    <input name="page_id" id="page_id" type="hidden" value="<?php echo $res['id'];?>"/>
    <input name="module" id="module" type="hidden" value="university"/>
    <input name="process" id="process" type="hidden" value=""/>
    <input type="submit" value="Submit" name="save_gadgettech">&nbsp;<input type="reset" name="reset" value="Clear" /></td>
</tr>
</table>
</form>